home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / fpkpas92.zip / SRCRTL.ZIP / RTL / DOS / MOVE.PPI < prev    next >
Text File  |  1997-07-01  |  4KB  |  207 lines

  1. procedure MoveLong(selector:word;dst:pointer;cnt:longint);
  2. begin
  3.   asm 
  4.     movw    %fs,%dx
  5.     movw    selector,%ax
  6.     movw    %ax,%fs
  7.     xorl    %esi,%esi
  8.     movl    DST,%edi
  9.     movl    CNT,%ecx
  10.     shrl    $0x2,%ecx
  11.   MOVE1:
  12.     movl    %fs:(%esi,%ecx,4),%eax
  13.     movl    %eax,(%edi,%ecx,4)
  14.     decl    %ecx
  15.     jns     MOVE1
  16.     movw    %dx,%fs
  17.   end;
  18. end;
  19.  
  20. procedure ScreenToMem(Source,Target,Counter:longint);
  21. begin
  22.   asm
  23.     pushw  %ds
  24.     movl   counter,%ecx
  25.     movl   %ecx,%ebx
  26.     shrl   $0x2,%ecx
  27.     andl   $0x3,%ebx
  28.     movl   target,%edi
  29.     movl   source,%esi
  30.     addl   _WBUFFER,%esi
  31.     movw   _SEG_WRITE,%ax
  32.     movw   %ax,%ds
  33.     rep
  34.     movsl
  35.     movl   %ebx,%ecx
  36.     rep
  37.     movsb
  38.     popw   %ds
  39.   end;
  40. end;
  41.  
  42. procedure MemToScreen(Source,Target,Counter:longint);
  43. begin
  44.   asm
  45.     movw   %es,%dx
  46.     movl   counter,%ecx
  47.     movl   %ecx,%ebx
  48.     shrl   $0x2,%ecx
  49.     andl   $0x3,%ebx
  50.     movl   target,%edi
  51.     movl   source,%esi
  52.     addl   _WBUFFER,%edi
  53.     movw   _SEG_WRITE,%ax
  54.     movw   %ax,%es
  55.     rep
  56.     movsl
  57.     movl   %ebx,%ecx
  58.     rep
  59.     movsb
  60.     movw   %dx,%es
  61.   end;
  62. end;
  63.  
  64. procedure MemAndScreen(Source,Target,Counter:longint);
  65. begin
  66.   asm
  67.     pushw  %es
  68.     movl   counter,%ecx
  69.     movl   %ecx,%ebx
  70.     shrl   $0x2,%ecx
  71.     andl   $0x3,%ebx
  72.     movl   target,%edi
  73.     movl   source,%esi
  74.     movl   $4,%edx
  75.     addl   _WBUFFER,%edi
  76.     movw   _SEG_WRITE,%ax
  77.     movw   %ax,%es
  78. mas_lloop:
  79.     movl   (%esi),%eax
  80.     andl   %eax,%es:(%edi)
  81.     addl   %edx,%edi
  82.     addl   %edx,%esi
  83.     decl   %ecx
  84.     jnz    mas_lloop
  85.     orl    %ebx,%ecx
  86.     jz     mas_end
  87. mas_bloop:
  88.     movb   (%esi),%al
  89.     andb   %al,%es:(%edi)
  90.     incl   %esi
  91.     incl   %edi
  92.     decl   %ecx
  93.     jnz    mas_bloop
  94. mas_end:
  95.     popw   %es
  96.   end;
  97. end;
  98.  
  99. procedure MemOrScreen(Source,Target,Counter:longint);
  100. begin
  101.   asm
  102.     pushw  %es
  103.     movl   counter,%ecx
  104.     movl   %ecx,%ebx
  105.     shrl   $0x2,%ecx
  106.     andl   $0x3,%ebx
  107.     movl   target,%edi
  108.     movl   source,%esi
  109.     addl   _WBUFFER,%edi
  110.     movw   _SEG_WRITE,%ax
  111.     movw   %ax,%es
  112. mos_lloop:
  113.     movl   (%esi),%eax
  114.     orl    %eax,%es:(%edi)
  115.     addl   $4,%edi
  116.     addl   $4,%esi
  117.     decl   %ecx
  118.     jnz    mos_lloop
  119.     orl    %ebx,%ecx
  120.     jz     mos_end
  121. mos_bloop:
  122.     movb   (%esi),%al
  123.     orb    %al,%es:(%edi)
  124.     incl   %esi
  125.     incl   %edi
  126.     decl   %ecx
  127.     jnz    mos_bloop
  128. mos_end:
  129.     popw   %es
  130.   end;
  131. end;
  132.  
  133. procedure MemXorScreen(Source,Target,Counter:longint);
  134. begin
  135.   asm
  136.     movw   %es,%dx
  137.     movl   counter,%ecx
  138.     movl   %ecx,%ebx
  139.     shrl   $0x2,%ecx
  140.     andl   $0x3,%ebx
  141.     movl   target,%edi
  142.     movl   source,%esi
  143.     addl   _WBUFFER,%edi
  144.     movw   _SEG_WRITE,%ax
  145.     movw   %ax,%es
  146.     jecxz  mxs_b
  147. mxs_lloop:
  148.     movl   (%esi),%eax
  149.     xorl   %eax,%es:(%edi)
  150.     addl   $4,%edi
  151.     addl   $4,%esi
  152.     decl   %ecx
  153.     jnz    mxs_lloop
  154. mxs_b:
  155.     orl    %ebx,%ecx
  156.     jz     mxs_end
  157. mxs_bloop:
  158.     movb   (%esi),%al
  159.     xorb   %al,%es:(%edi)
  160.     incl   %esi
  161.     incl   %edi
  162.     decl   %ecx
  163.     jnz    mxs_bloop
  164. mxs_end:
  165.     movw   %dx,%es
  166.   end;
  167. end;
  168.  
  169. procedure MemNotScreen(Source,Target,Counter:longint);
  170. begin
  171.   asm
  172.     pushw  %es
  173.     movl   counter,%ecx
  174.     movl   %ecx,%ebx
  175.     shrl   $0x2,%ecx
  176.     andl   $0x3,%ebx
  177.     movl   target,%edi
  178.     movl   source,%esi
  179.     addl   _WBUFFER,%edi
  180.     movw   _SEG_WRITE,%ax
  181.     movw   %ax,%es
  182.     jecxz  mns_b
  183. mns_lloop:
  184.     movl   (%esi),%eax
  185.     notl   %eax
  186.     movl   %eax,%es:(%edi)
  187.     addl   $4,%edi
  188.     addl   $4,%esi
  189.     decl   %ecx
  190.     jnz    mns_lloop
  191. mns_b:
  192.     orl    %ebx,%ecx
  193.     jz     mns_end
  194. mns_bloop:
  195.     movb   (%esi),%al
  196.     notb   %al
  197.     movb   %al,%es:(%edi)
  198.     incl   %esi
  199.     incl   %edi
  200.     decl   %ecx
  201.     jnz    mns_bloop
  202. mns_end:
  203.     popw   %es
  204.   end;
  205. end;
  206.  
  207.